package com.dandelion.common.dao.auto.mapper;

import com.dandelion.common.dao.auto.pojo.Order;
import com.dandelion.common.dao.auto.pojo.OrderCriteria;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectKey;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface OrderMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_order
     *
     * @mbg.generated Mon Jun 18 12:33:43 CST 2018
     */
    @SelectProvider(type=OrderSqlProvider.class, method="countByExample")
    long countByExample(OrderCriteria example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_order
     *
     * @mbg.generated Mon Jun 18 12:33:43 CST 2018
     */
    @DeleteProvider(type=OrderSqlProvider.class, method="deleteByExample")
    int deleteByExample(OrderCriteria example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_order
     *
     * @mbg.generated Mon Jun 18 12:33:43 CST 2018
     */
    @Delete({
        "delete from t_order",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int deleteByPrimaryKey(Long id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_order
     *
     * @mbg.generated Mon Jun 18 12:33:43 CST 2018
     */
    @Insert({
        "insert into t_order (order_no, user_id, ",
        "order_cct_name, order_cct_mobile, ",
        "top_cat_id, svr_id, ",
        "cst_name, cst_mobile, ",
        "cst_addr_prov_code, cst_addr_city_code, ",
        "cst_addr_area_code, cst_addr_dist_code, ",
        "cst_addr_detail, bld_lift, ",
        "bld_floor, verify, ",
        "verify_code, cst_expect_deliver_date, ",
        "expr_status, expr_com_id, ",
        "expr_order_no, pk_addr, ",
        "pk_cct_name, pk_cct_mobile, ",
        "pkg_num, pre_fr_pay, ",
        "est_deliver_date, special_req, ",
        "status, is_deleted, ",
        "create_time, update_time)",
        "values (#{orderNo,jdbcType=VARCHAR}, #{userId,jdbcType=BIGINT}, ",
        "#{orderCctName,jdbcType=VARCHAR}, #{orderCctMobile,jdbcType=VARCHAR}, ",
        "#{topCatId,jdbcType=INTEGER}, #{svrId,jdbcType=INTEGER}, ",
        "#{cstName,jdbcType=VARCHAR}, #{cstMobile,jdbcType=VARCHAR}, ",
        "#{cstAddrProvCode,jdbcType=VARCHAR}, #{cstAddrCityCode,jdbcType=VARCHAR}, ",
        "#{cstAddrAreaCode,jdbcType=VARCHAR}, #{cstAddrDistCode,jdbcType=VARCHAR}, ",
        "#{cstAddrDetail,jdbcType=VARCHAR}, #{bldLift,jdbcType=TINYINT}, ",
        "#{bldFloor,jdbcType=VARCHAR}, #{verify,jdbcType=TINYINT}, ",
        "#{verifyCode,jdbcType=VARCHAR}, #{cstExpectDeliverDate,jdbcType=VARCHAR}, ",
        "#{exprStatus,jdbcType=TINYINT}, #{exprComId,jdbcType=INTEGER}, ",
        "#{exprOrderNo,jdbcType=VARCHAR}, #{pkAddr,jdbcType=VARCHAR}, ",
        "#{pkCctName,jdbcType=VARCHAR}, #{pkCctMobile,jdbcType=VARCHAR}, ",
        "#{pkgNum,jdbcType=INTEGER}, #{preFrPay,jdbcType=TINYINT}, ",
        "#{estDeliverDate,jdbcType=VARCHAR}, #{specialReq,jdbcType=VARCHAR}, ",
        "#{status,jdbcType=TINYINT}, #{isDeleted,jdbcType=TINYINT}, ",
        "#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP})"
    })
    @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="id", before=false, resultType=Long.class)
    int insert(Order record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_order
     *
     * @mbg.generated Mon Jun 18 12:33:43 CST 2018
     */
    @InsertProvider(type=OrderSqlProvider.class, method="insertSelective")
    @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="id", before=false, resultType=Long.class)
    int insertSelective(Order record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_order
     *
     * @mbg.generated Mon Jun 18 12:33:43 CST 2018
     */
    @SelectProvider(type=OrderSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="order_no", property="orderNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="user_id", property="userId", jdbcType=JdbcType.BIGINT),
        @Result(column="order_cct_name", property="orderCctName", jdbcType=JdbcType.VARCHAR),
        @Result(column="order_cct_mobile", property="orderCctMobile", jdbcType=JdbcType.VARCHAR),
        @Result(column="top_cat_id", property="topCatId", jdbcType=JdbcType.INTEGER),
        @Result(column="svr_id", property="svrId", jdbcType=JdbcType.INTEGER),
        @Result(column="cst_name", property="cstName", jdbcType=JdbcType.VARCHAR),
        @Result(column="cst_mobile", property="cstMobile", jdbcType=JdbcType.VARCHAR),
        @Result(column="cst_addr_prov_code", property="cstAddrProvCode", jdbcType=JdbcType.VARCHAR),
        @Result(column="cst_addr_city_code", property="cstAddrCityCode", jdbcType=JdbcType.VARCHAR),
        @Result(column="cst_addr_area_code", property="cstAddrAreaCode", jdbcType=JdbcType.VARCHAR),
        @Result(column="cst_addr_dist_code", property="cstAddrDistCode", jdbcType=JdbcType.VARCHAR),
        @Result(column="cst_addr_detail", property="cstAddrDetail", jdbcType=JdbcType.VARCHAR),
        @Result(column="bld_lift", property="bldLift", jdbcType=JdbcType.TINYINT),
        @Result(column="bld_floor", property="bldFloor", jdbcType=JdbcType.VARCHAR),
        @Result(column="verify", property="verify", jdbcType=JdbcType.TINYINT),
        @Result(column="verify_code", property="verifyCode", jdbcType=JdbcType.VARCHAR),
        @Result(column="cst_expect_deliver_date", property="cstExpectDeliverDate", jdbcType=JdbcType.VARCHAR),
        @Result(column="expr_status", property="exprStatus", jdbcType=JdbcType.TINYINT),
        @Result(column="expr_com_id", property="exprComId", jdbcType=JdbcType.INTEGER),
        @Result(column="expr_order_no", property="exprOrderNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="pk_addr", property="pkAddr", jdbcType=JdbcType.VARCHAR),
        @Result(column="pk_cct_name", property="pkCctName", jdbcType=JdbcType.VARCHAR),
        @Result(column="pk_cct_mobile", property="pkCctMobile", jdbcType=JdbcType.VARCHAR),
        @Result(column="pkg_num", property="pkgNum", jdbcType=JdbcType.INTEGER),
        @Result(column="pre_fr_pay", property="preFrPay", jdbcType=JdbcType.TINYINT),
        @Result(column="est_deliver_date", property="estDeliverDate", jdbcType=JdbcType.VARCHAR),
        @Result(column="special_req", property="specialReq", jdbcType=JdbcType.VARCHAR),
        @Result(column="status", property="status", jdbcType=JdbcType.TINYINT),
        @Result(column="is_deleted", property="isDeleted", jdbcType=JdbcType.TINYINT),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP)
    })
    List<Order> selectByExample(OrderCriteria example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_order
     *
     * @mbg.generated Mon Jun 18 12:33:43 CST 2018
     */
    @Select({
        "select",
        "id, order_no, user_id, order_cct_name, order_cct_mobile, top_cat_id, svr_id, ",
        "cst_name, cst_mobile, cst_addr_prov_code, cst_addr_city_code, cst_addr_area_code, ",
        "cst_addr_dist_code, cst_addr_detail, bld_lift, bld_floor, verify, verify_code, ",
        "cst_expect_deliver_date, expr_status, expr_com_id, expr_order_no, pk_addr, pk_cct_name, ",
        "pk_cct_mobile, pkg_num, pre_fr_pay, est_deliver_date, special_req, status, is_deleted, ",
        "create_time, update_time",
        "from t_order",
        "where id = #{id,jdbcType=BIGINT}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="order_no", property="orderNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="user_id", property="userId", jdbcType=JdbcType.BIGINT),
        @Result(column="order_cct_name", property="orderCctName", jdbcType=JdbcType.VARCHAR),
        @Result(column="order_cct_mobile", property="orderCctMobile", jdbcType=JdbcType.VARCHAR),
        @Result(column="top_cat_id", property="topCatId", jdbcType=JdbcType.INTEGER),
        @Result(column="svr_id", property="svrId", jdbcType=JdbcType.INTEGER),
        @Result(column="cst_name", property="cstName", jdbcType=JdbcType.VARCHAR),
        @Result(column="cst_mobile", property="cstMobile", jdbcType=JdbcType.VARCHAR),
        @Result(column="cst_addr_prov_code", property="cstAddrProvCode", jdbcType=JdbcType.VARCHAR),
        @Result(column="cst_addr_city_code", property="cstAddrCityCode", jdbcType=JdbcType.VARCHAR),
        @Result(column="cst_addr_area_code", property="cstAddrAreaCode", jdbcType=JdbcType.VARCHAR),
        @Result(column="cst_addr_dist_code", property="cstAddrDistCode", jdbcType=JdbcType.VARCHAR),
        @Result(column="cst_addr_detail", property="cstAddrDetail", jdbcType=JdbcType.VARCHAR),
        @Result(column="bld_lift", property="bldLift", jdbcType=JdbcType.TINYINT),
        @Result(column="bld_floor", property="bldFloor", jdbcType=JdbcType.VARCHAR),
        @Result(column="verify", property="verify", jdbcType=JdbcType.TINYINT),
        @Result(column="verify_code", property="verifyCode", jdbcType=JdbcType.VARCHAR),
        @Result(column="cst_expect_deliver_date", property="cstExpectDeliverDate", jdbcType=JdbcType.VARCHAR),
        @Result(column="expr_status", property="exprStatus", jdbcType=JdbcType.TINYINT),
        @Result(column="expr_com_id", property="exprComId", jdbcType=JdbcType.INTEGER),
        @Result(column="expr_order_no", property="exprOrderNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="pk_addr", property="pkAddr", jdbcType=JdbcType.VARCHAR),
        @Result(column="pk_cct_name", property="pkCctName", jdbcType=JdbcType.VARCHAR),
        @Result(column="pk_cct_mobile", property="pkCctMobile", jdbcType=JdbcType.VARCHAR),
        @Result(column="pkg_num", property="pkgNum", jdbcType=JdbcType.INTEGER),
        @Result(column="pre_fr_pay", property="preFrPay", jdbcType=JdbcType.TINYINT),
        @Result(column="est_deliver_date", property="estDeliverDate", jdbcType=JdbcType.VARCHAR),
        @Result(column="special_req", property="specialReq", jdbcType=JdbcType.VARCHAR),
        @Result(column="status", property="status", jdbcType=JdbcType.TINYINT),
        @Result(column="is_deleted", property="isDeleted", jdbcType=JdbcType.TINYINT),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP)
    })
    Order selectByPrimaryKey(Long id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_order
     *
     * @mbg.generated Mon Jun 18 12:33:43 CST 2018
     */
    @UpdateProvider(type=OrderSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") Order record, @Param("example") OrderCriteria example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_order
     *
     * @mbg.generated Mon Jun 18 12:33:43 CST 2018
     */
    @UpdateProvider(type=OrderSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") Order record, @Param("example") OrderCriteria example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_order
     *
     * @mbg.generated Mon Jun 18 12:33:43 CST 2018
     */
    @UpdateProvider(type=OrderSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(Order record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_order
     *
     * @mbg.generated Mon Jun 18 12:33:43 CST 2018
     */
    @Update({
        "update t_order",
        "set order_no = #{orderNo,jdbcType=VARCHAR},",
          "user_id = #{userId,jdbcType=BIGINT},",
          "order_cct_name = #{orderCctName,jdbcType=VARCHAR},",
          "order_cct_mobile = #{orderCctMobile,jdbcType=VARCHAR},",
          "top_cat_id = #{topCatId,jdbcType=INTEGER},",
          "svr_id = #{svrId,jdbcType=INTEGER},",
          "cst_name = #{cstName,jdbcType=VARCHAR},",
          "cst_mobile = #{cstMobile,jdbcType=VARCHAR},",
          "cst_addr_prov_code = #{cstAddrProvCode,jdbcType=VARCHAR},",
          "cst_addr_city_code = #{cstAddrCityCode,jdbcType=VARCHAR},",
          "cst_addr_area_code = #{cstAddrAreaCode,jdbcType=VARCHAR},",
          "cst_addr_dist_code = #{cstAddrDistCode,jdbcType=VARCHAR},",
          "cst_addr_detail = #{cstAddrDetail,jdbcType=VARCHAR},",
          "bld_lift = #{bldLift,jdbcType=TINYINT},",
          "bld_floor = #{bldFloor,jdbcType=VARCHAR},",
          "verify = #{verify,jdbcType=TINYINT},",
          "verify_code = #{verifyCode,jdbcType=VARCHAR},",
          "cst_expect_deliver_date = #{cstExpectDeliverDate,jdbcType=VARCHAR},",
          "expr_status = #{exprStatus,jdbcType=TINYINT},",
          "expr_com_id = #{exprComId,jdbcType=INTEGER},",
          "expr_order_no = #{exprOrderNo,jdbcType=VARCHAR},",
          "pk_addr = #{pkAddr,jdbcType=VARCHAR},",
          "pk_cct_name = #{pkCctName,jdbcType=VARCHAR},",
          "pk_cct_mobile = #{pkCctMobile,jdbcType=VARCHAR},",
          "pkg_num = #{pkgNum,jdbcType=INTEGER},",
          "pre_fr_pay = #{preFrPay,jdbcType=TINYINT},",
          "est_deliver_date = #{estDeliverDate,jdbcType=VARCHAR},",
          "special_req = #{specialReq,jdbcType=VARCHAR},",
          "status = #{status,jdbcType=TINYINT},",
          "is_deleted = #{isDeleted,jdbcType=TINYINT},",
          "create_time = #{createTime,jdbcType=TIMESTAMP},",
          "update_time = #{updateTime,jdbcType=TIMESTAMP}",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int updateByPrimaryKey(Order record);
}